package workers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;

import model.Software;
import workerUIs.StepFrame;
import workflow.step.UIImplementationStep;

public class UIStepWorker extends AbstractStepSwingWorker {


	public UIStepWorker(StepFrame frame, String inputQueueName,
			String outputQueueName) {
		super(frame, inputQueueName, outputQueueName);
	}
	
	@Override
	protected void doStep(Software software) {
		new UIImplementationStep().doStep(this.software);
	}	
	
	public static void main(String[] args) {
		Logger logger = Logger.getLogger(ArchitectureStepWorker.class.getCanonicalName());
		try
		{
			final StepFrame uiImplFrame = new StepFrame("Step3b: UI Impl", 800, 400);			
			uiImplFrame.getNextButton().addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					new UIStepWorker(uiImplFrame, IMQConstants.ARCH_OUTPUT_UI_INPUT, IMQConstants.UI_OUTPUT_INTEGRATION_INPUT).execute();				
				}
			});			
			new QueueDepthObserver().observeQueueDepth(uiImplFrame, IMQConstants.ARCH_OUTPUT_UI_INPUT);

		}
		catch (Exception e)
		{
			logger.log(Level.SEVERE, "Error during initialization: ", e);
		}
	}


}
